<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" />
		<link rel="stylesheet" href="css/Site.css" />
		<link rel="stylesheet" href="css/zy.all.css" />
		<link rel="stylesheet" href="css/font-awesome.min.css" />
		<link rel="stylesheet" href="css/amazeui.min.css" />
		<link rel="stylesheet" href="css/admin.css" />
		<style type="text/css">
				.a1{
					margin-left: 300px;
				}
				.a2{
					margin-left: 100px;
				}
		</style>
	</head>

	<body>
		<div class="dvcontent">
			
			<div style="margin: 30px;">
			<form action="findName"  method="post" style="display: inline-block;">
				<input type="text" name="tex" placeholder="名称/订单/编号" style="font-size: 20px;" id="tex"/>
				<input type="text" value="3"  style="display: none;" name="n"/>
				<input type="submit" value="搜索" id="soso"/>
			</form>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<form action="FindState" method="post"  style="display: inline-block;">
				<span style="font-size: 20px;">分类查询</span>
				<select style="font-size: 20px;" name="op">
					<option value="0">===请选择类型===</option>
					<option value="0">所有订单</option>
					<option value="1">已成交订单</option>
					<option value="2">未成交订单</option>
				</select>
				<input type="submit" value="搜索" />
			</form>
			</div>

			<div>
				<!--tab start-->
				<div class="tabs">
					<div class="hd">
						<ul>
							<li class="on" style="box-sizing: initial;-webkit-box-sizing: initial;">查看订单</li>
						</ul>
					</div>
					<div class="bd">
						<ul style="display: block;padding: 20px;">
							<li>
								<!--分页显示角色信息 start-->
								<div id="dv1">
									<table class="table" id="tbRecord">
										<thead>
											<tr>
												<th>订单编号</th>
												<th>商品名称</th>
												<th>用户电话</th>
												<th>创建时间</th>
												<th>数量</th>
												<th>单价</th>
												<th>成交价格</th>
												<th>状态</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<tr th:each="od:${pages.getResult()}">
												<td th:text="${od.order_id}"></td>
												<td th:text="${od.comm.commodity_name}"></td>
												<td th:text="${od.user.user_phone}"></td>
												<td th:text="${od.order_generation_time}"></td>
												<td th:text="${od.comm.commodity_quantitysold}"></td>
												<td th:text="${od.comm.commodity_price}"></td>
												<td>￥2000</td>
												<td th:if="${od.order_state==1}">已完成</td>
												<td th:if="${od.order_state==2}">未完成</td>
												<td class="edit">
													<!-- <a th href="@{/del(id=${od.order_id})}"><button><i class="icon-edit bigger-120"></i>删除</button></a> -->
													<a th:href="@{/del(id=${od.order_id})}">删除</a> 
												</td>
											</tr>
										</tbody>

									</table>
									<span th:if="${o==0}">
									总记录数：<span th:text="${count}"></span>								
									<a th:href="@{/FindState(num=1,op=0)}" class="a1">首页</a> 
									<a th:href="@{/FindState(num=${pages.getPageNum()-1},op=0)}"class="a2" >上一页</a>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span th:text="${num}"></span>/<span th:text="${pageNum}"></span>
									<a th:href="@{/FindState(num=${pages.getPageNum()+1},op=0)}"class="a2">下一页</a>
									<a th:href="@{/FindState(num=${pages.getPages()},op=0)}"class="a2">尾页</a>
									</span>
									
									<span th:if="${o==1}">
									总记录数：<span th:text="${count}"></span>								
									<a th:href="@{/FindState(num=1,op=1)}" class="a1">首页</a> 
									<a th:href="@{/FindState(num=${pages.getPageNum()-1},op=1)}"class="a2" >上一页</a>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span th:text="${num}"></span>/<span th:text="${pageNum}"></span>
									<a th:href="@{/FindState(num=${pages.getPageNum()+1},op=1)}"class="a2">下一页</a>
									<a th:href="@{/FindState(num=${pages.getPages()},op=1)}"class="a2">尾页</a>
									</span>
									
									<span th:if="${o==2}">
									总记录数：<span th:text="${count}"></span>								
									<a th:href="@{/FindState(num=1,op=2)}" class="a1">首页</a> 
									<a th:href="@{/FindState(num=${pages.getPageNum()-1},op=2)}"class="a2" >上一页</a>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span th:text="${num}"></span>/<span th:text="${pageNum}"></span>
									<a th:href="@{/FindState(num=${pages.getPageNum()+1},op=2)}"class="a2">下一页</a>
									<a th:href="@{/FindState(num=${pages.getPages()},op=2)}"class="a2">尾页</a>
									</span>
									
									<span th:if="${o==3}">
									总记录数：<span th:text="${count}"></span>								
									<a th:href="@{/findName(num=1,tex=${tex})}" class="a1">首页</a> 
									<a th:href="@{/findName(num=${pages.getPageNum()-1},tex=${tex})}"class="a2" >上一页</a>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span th:text="${num}"></span>/<span th:text="${pageNum}"></span>
									<a th:href="@{/findName(num=${pages.getPageNum()+1},tex=${tex})}"class="a2">下一页</a>
									<a th:href="@{/findName(num=${pages.getPages()},tex=${tex})}"class="a2">尾页</a>
									</span>
								</div>
								<!--分页显示角色信息 end-->
							</li>
						</ul>

								<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
								<script src="js/plugs/Jqueryplugs.js" type="text/javascript"></script>
								<script src="js/_layout.js"></script>
								<script src="js/plugs/jquery.SuperSlide.source.js"></script>
								<script>
									var num = 1;
									$(function() {

										$(".tabs").slide({
											trigger: "click"
										});

									});

									var btn_save = function() {
										var pid = $("#RawMaterialsTypePageId  option:selected").val();
										var name = $("#RawMaterialsTypeName").val();
										var desc = $("#RawMaterialsTypeDescription").val();
										var ramark = $("#Ramark").val();
										$.ajax({
											type: "post",
											url: "/RawMaterialsType/AddRawMaterialsType",
											data: {
												name: name,
												pid: pid,
												desc: desc,
												ramark: ramark
											},
											success: function(data) {
												if(data > 0) {
													$.jq_Alert({
														message: "添加成功",
														btnOktext: "确认",
														dialogModal: true,
														btnOkClick: function() {
															//$("#RawMaterialsTypeName").val("");
															//$("#RawMaterialsTypeDescription").val("");
															//$("#Ramark").val("");                           
															//page1();
															location.reload();

														}
													});
												}
											}
										});
										alert(t);
									}

									/* var btn_edit = function(id) {
										$.jq_Panel({
											url: "/RawMaterialsType/EditRawMaterialsType?id=" + id,
											title: "编辑分类",
											dialogModal: true,
											iframeWidth: 500,
											iframeHeight: 400
										});
									} */
									/* var btn_delete = function(id) {
										$.jq_Confirm({
											message: "您确定要删除吗?",
											btnOkClick: function() {
												$.ajax({
													type: "post",
													url: "/RawMaterialsType/DeleteRawMaterialsType",
													data: {
														id: id
													},
													success: function(data) {
														if(data > 0) {
															$.jq_Alert({
																message: "删除成功",
																btnOkClick: function() {
																	page1();
																}
															});
														}
													}
												});
											}
										});																					
									} */
									
									/* $(function(){
										$("#soso").click(function(){											
											var te = $("#tex").val();
											alert(te);
										});	
									}); */
								</script>

							</div>
	</body>

</html>